home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / tcp_ip / tnos / tnos100s / internet.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-03-15  |  1.8 KB  |  70 lines

  1. /* Mods by PA0GRI */
  2. #ifndef    _INTERNET_H
  3. #define    _INTERNET_H
  4.  
  5. #ifndef    _GLOBAL_H
  6. #include "global.h"
  7. #endif
  8.  
  9. /* Global structures and constants pertaining to the interface between IP and
  10.  *     higher level protocols
  11.  */
  12.  
  13. /* IP protocol field values */
  14. #define    ICMP_PTCL    1    /* Internet Control Message Protocol */
  15. #define    TCP_PTCL    6    /* Transmission Control Protocol */
  16. #define    UDP_PTCL    17    /* User Datagram Protocol */
  17. #define    RSPF_PTCL    73    /* Radio Shortest Path First Protocol */
  18. #define    AX25_PTCL    93    /* AX25 inside IP according to RFC-1226 */
  19. #define    IP_PTCL        94    /* IP inside IP */
  20.  
  21. #define    MAXTTL        255    /* Maximum possible IP time-to-live value */
  22.  
  23. /* DoD-style precedences */
  24. #define    IP_PRECEDENCE    0xe0    /* Mask for precedence field */
  25. #define    ROUTINE        0x00
  26. #define    PRIORITY    0x20
  27. #define    IMMEDIATE    0x40
  28. #define    FLASH        0x60
  29. #define    FLASH_OVER    0x80
  30. #define    CRITIC        0xa0
  31. #define    INET_CTL    0xc0
  32. #define    NET_CTL        0xe0
  33.  
  34. /* Amateur-style precedences */
  35. #define    AM_ROUTINE    0x00
  36. #define    AM_WELFARE    0x20
  37. #define    AM_PRIORITY    0x40
  38. #define    AM_EMERGENCY    0x60
  39.  
  40. /* Class-of-service bits */
  41. #define    IP_COS        0x1c    /* Mask for class-of-service bits */
  42. #define    LOW_DELAY    0x10
  43. #define    THROUGHPUT    0x08
  44. #define    RELIABILITY    0x04
  45.  
  46. /* IP TOS fields */
  47. #define    PREC(x)        (((x)>>5) & 0x7)
  48. #define    DELAY        0x10
  49. #define    THRUPUT        0x8
  50. #define    RELIABLITY    0x4
  51.  
  52. /* Pseudo-header for TCP and UDP checksumming */
  53. struct pseudo_header {
  54.     int32 source;        /* IP source */
  55.     int32 dest;        /* IP destination */
  56.     char protocol;        /* Protocol */
  57.     int16 length;        /* Data field length */
  58. };
  59. #define    NULLHEADER    (struct pseudo_header *)0
  60.  
  61. /* Format of a MIB entry for statistics gathering */
  62. struct mib_entry {
  63.     char *name;
  64.     struct {
  65.         int32 integer;
  66.     } value;
  67. };
  68.  
  69. #endif    /* _INTERNET_H */
  70.